using CardGameObject.GameScene;
using Common;

namespace CardEffect
{
    public class PlayerEffect
    {
        private GameManager GameManager { get; set; } = GameManager.GetInstance();

        public void RecoverOwner(int value)
        {
            if(GameManager.CurLaunchRole == PlayerRoleEnum.PLAYER)
            {
                GameManager.PlayerAvatar.GetComponent<GamePlayer>().Recover(value);
            }
            else
            {
                GameManager.AiAvatar.GetComponent<GamePlayer>().Recover(value);
            }
        }

        public void DamageOpponent(int value)
        {
            if(GameManager.CurLaunchRole == PlayerRoleEnum.PLAYER)
            {
                GameManager.AiAvatar.GetComponent<GamePlayer>().TakeDamage(value);
            }
            else
            {   
                GameManager.PlayerAvatar.GetComponent<GamePlayer>().TakeDamage(value);
            }
        }
    }
}